package com.prime.tutorial.moviestore.view.admin;

import com.prime.tutorial.moviestore.domain.Users;
import com.prime.tutorial.moviestore.service.admin.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * Users: me
 * Date: 22 лют 2010
 * Time: 10:08:54
 * @author iryna.masyuk
 */
@Component("userList")
@Scope("request")
public class UserList implements Serializable {
    public List<Users> getUsers() {
        return users;
    }

    public void setUsers(List<Users> users) {
        this.users = users;
    }

    private List<Users> users;
    private AdminService adminService;

    @Autowired
    public UserList(AdminService adminService) {
        this.adminService = adminService;
        users = adminService.getAllUsers();
    }
}
